package com.zhangyusheng.easyecharts.component;


import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * TODO: Y轴
 *
 * @author Michael zhang
 * @email zhangys_0217@sina.com
 * @since 2025年11月03日
 */

@Data
@Accessors(chain = true)
public class YAxis implements Serializable {
    private final static long serialVersionUID = 2L;

    private String type;
    private AxisLine axisLine;
    private AxisLabel axisLabel;
    private AxisTick axisTick;
    private SplitLine splitLine;
    private List<String> data;


    public static class Builder{
        private String type;
        private AxisLine axisLine;
        private AxisLabel axisLabel;
        private AxisTick axisTick;
        private SplitLine splitLine;
        private List<String> data;

        public Builder type(String type){
            this.type = type;
            //return this; 的意图是支持方法链式调用
            return this;
        }
        public Builder axisLine(AxisLine axisLine){
            this.axisLine = axisLine;
            return this;
        }
        public Builder axisLabel(AxisLabel axisLabel){
            this.axisLabel = axisLabel;
            return this;
        }
        public Builder axisTick(AxisTick axisTick){
            this.axisTick = axisTick;
            return this;
        }
        public Builder splitLine(SplitLine splitLine){
            this.splitLine = splitLine;
            return this;
        }
        public Builder data(List<String> data){
            this.data = data;
            return this;
        }


        public YAxis build(){
            return new YAxis(this);
        }
    }
    private YAxis(Builder builder){
        this.type = builder.type;
        this.axisLine = builder.axisLine;
        this.axisLabel = builder.axisLabel;
        this.axisTick = builder.axisTick;
        this.splitLine = builder.splitLine;
        this.data = builder.data;
    }
}
